package com.goodving.guli.utility;

import android.animation.Animator;
import android.animation.ObjectAnimator;
import android.animation.PropertyValuesHolder;
import android.app.ActionBar;
import android.graphics.Point;
import android.view.View;
import android.view.animation.AlphaAnimation;
import android.view.animation.ScaleAnimation;
import android.view.animation.TranslateAnimation;

import java.lang.reflect.InvocationTargetException;

/**
 * Created by Administrator on 2015-11-17.
 */
public class C1460b {
    public static AlphaAnimation m11916a() {
        AlphaAnimation alphaAnimation = new AlphaAnimation(0.0f, C1965e.f9059c);
        alphaAnimation.setDuration(300);
        return alphaAnimation;
    }

    public static AlphaAnimation m11923b() {
        AlphaAnimation alphaAnimation = new AlphaAnimation(C1965e.f9059c, 0.0f);
        alphaAnimation.setDuration(300);
        return alphaAnimation;
    }

    public static ScaleAnimation m11925c() {
        ScaleAnimation scaleAnimation = new ScaleAnimation(0.0f, C1965e.f9059c, 0.0f, C1965e.f9059c, 1, 0.5f, 1, 0.5f);
        scaleAnimation.setDuration(300);
        return scaleAnimation;
    }

    public static TranslateAnimation m11926d() {
        TranslateAnimation translateAnimation = new TranslateAnimation(1, 0.0f, 1, 0.0f, 1, 0.0f, 1, -1.0F);
        translateAnimation.setDuration(300);
        translateAnimation.setFillAfter(false);
        return translateAnimation;
    }

    public static void m11917a(ActionBar actionBar, boolean z) {
        try {
            actionBar.getClass().getDeclaredMethod("setShowHideAnimationEnabled", new Class[]{Boolean.TYPE}).invoke(actionBar, new Object[]{Boolean.valueOf(z)});
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        } catch (InvocationTargetException e2) {
            e2.printStackTrace();
        } catch (NoSuchMethodException e3) {
            e3.printStackTrace();
        }
    }

    public static void m11920a(View view, Point point) {
        C1460b.m11921a(view, point, 300);
    }

    public static void m11921a(View view, Point point, long j) {
        PropertyValuesHolder ofFloat = PropertyValuesHolder.ofFloat("translationX", new float[]{(float) point.x});
        PropertyValuesHolder ofFloat2 = PropertyValuesHolder.ofFloat("translationY", new float[]{(float) point.y});
        ObjectAnimator ofPropertyValuesHolder = ObjectAnimator.ofPropertyValuesHolder(view, new PropertyValuesHolder[]{ofFloat, ofFloat2});
        ofPropertyValuesHolder.setDuration(j);
        ofPropertyValuesHolder.start();
    }

    public static void m11922a(View view, Point point, Point point2) {
        PropertyValuesHolder ofFloat = PropertyValuesHolder.ofFloat("x", new float[]{(float) point.x, (float) point2.x});
        PropertyValuesHolder ofFloat2 = PropertyValuesHolder.ofFloat("y", new float[]{(float) point.y, (float) point2.y});
        ObjectAnimator.ofPropertyValuesHolder(view, new PropertyValuesHolder[]{ofFloat, ofFloat2}).start();
    }

    public static void m11924b(View view, Point point) {
        PropertyValuesHolder ofFloat = PropertyValuesHolder.ofFloat("x", new float[]{(float) point.x});
        PropertyValuesHolder ofFloat2 = PropertyValuesHolder.ofFloat("y", new float[]{(float) point.y});
        ObjectAnimator.ofPropertyValuesHolder(view, new PropertyValuesHolder[]{ofFloat, ofFloat2}).start();
    }

    public static void m11918a(View view, float f, float f2, float f3, float f4, long j) {
        C1460b.m11919a(view, f, f2, f3, f4, j, null);
    }

    public static void m11919a(View view, float f, float f2, float f3, float f4, long j, Animator.AnimatorListener animatorListener) {
        PropertyValuesHolder ofFloat;
        PropertyValuesHolder propertyValuesHolder = null;
        if (f == -10000.0f) {
            ofFloat = PropertyValuesHolder.ofFloat("x", new float[]{f3});
        } else if (f != -10000.0f) {
            ofFloat = PropertyValuesHolder.ofFloat("x", new float[]{f, f3});
        } else {
            ofFloat = null;
        }
        if (f2 == -10000.0f) {
            propertyValuesHolder = PropertyValuesHolder.ofFloat("y", new float[]{f4});
        } else if (f2 != -10000.0f) {
            propertyValuesHolder = PropertyValuesHolder.ofFloat("y", new float[]{f2, f4});
        }
        ObjectAnimator ofPropertyValuesHolder = ObjectAnimator.ofPropertyValuesHolder(view, new PropertyValuesHolder[]{ofFloat, propertyValuesHolder});
        if (j != -1) {
            ofPropertyValuesHolder.setDuration(j);
        }
        if (animatorListener != null) {
            ofPropertyValuesHolder.addListener(animatorListener);
        }
        ofPropertyValuesHolder.start();
    }
}
